package cal;
import org.apache.lucene.search.DefaultSimilarity;


public class MySimilarity extends DefaultSimilarity {
	
	public float coord(int overlap, int maxOverlap) {
		float overlap2 = (float)Math.pow(2, overlap);
		float maxOverlap2 = (float)Math.pow(2, maxOverlap);
		return (overlap2 / maxOverlap2);
	}
	public float tf(float freq) {   
		return (new Float(Math.log(1.0f+freq)).floatValue());
    }  
}